<?php
session_start ();
// 判断用户是否已经登录
if (! isset ( $_SESSION ["userinfo"] ) and empty ( $_SESSION ["userinfo"] ["userid"] )) {
	header ( "location:../index.php" );
	session_unset ();
	session_destroy ();
	exit ();
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Language" content="zh-CN">
<link href="../PersonalPhoto/Images/web_title.ico" rel="icon"
	type="image/x-icon" />
<link href="./Resource/Style/base.yy.css" rel="stylesheet"
	type="text/css" />
<title><?php echo $_SESSION ["userinfo"] ["username"];?>的资料</title>
<link href="./Resource/Style/info.yy.css" rel="stylesheet"
	type="text/css" />
</head>
<body>
<?php
require_once '../tools/SqlHelper.class.php';
$user_id = $_SESSION ["userinfo"] ["userid"];
$myname = $_SESSION ["userinfo"] ["username"];
// 创建一个SqlHelper对象
$sqlHelper = new SqlHelper ();
$sql = "select * from `personal_data_tb` where `user_id`='$user_id'";
$row = $sqlHelper->execute_dql ( $sql );
$res = mysql_fetch_array ( $row );
$ps_Icon = $res ['ps_Icon'];

$sql = "select count(user_receiver_id) from `message_tb` where `user_receiver_id`='$user_id'";
$res = $sqlHelper->execute_dql ( $sql );
$row = mysql_fetch_array ( $res );
$message_count = $row ['0'];

$sqlHelper->close_connect ();
?>
	<div class="yy_header">
		<div class="yy_nav">
			<span class="logo" title="找对象，上友缘网！"
				style="background-image: url('../PersonalPhoto/Images/logo.png');"><a
				href="#"></a></span>
			<ul>
				<li><a class="a_01 a_out" href="#"><span
						style="background-image: url('../PersonalPhoto/Images/Space.png');"></span>空间</a></li>
				<li><a class="a_01" href="../SearchMargin/SearchMarginIndex.php"><span
						style="background-image: url('../PersonalPhoto/Images/Search.png');"></span>搜缘</a></li>
				<li><a class="a_01" href="../Serve/ServeIndex.php"><span
						style="background-image: url('../PersonalPhoto/Images/Serve.png');">
					</span>服务</a></li>
				<li><a class="a_01" href="../Mailbox/MailboxIndex.php"><span
						style="background-image: url('../PersonalPhoto/Images/Mailbox.png');"></span>信箱</a></li>
			</ul>
			<div class="set_up ">
				<em class="tipParent"></em> <span style="font-size: 16px;"
					title="<?php echo $_SESSION ["userinfo"] ["username"];?>">你好，<?php echo $_SESSION ["userinfo"] ["username"];?>
					<a style="font-size: 12px;" href="../index.php?exit=1">安全退出</a></span>
			</div>
		</div>
	</div>

	<div class="yy_main">
		<div class="yy_main_L">
			<div class="own_menu">
				<a target="new" class="wy_head"
					href="../PersonalSpace/PersonalSpace.php?user_id=<?php echo $user_id;?>"><img
					alt="头像" width="84" height="84"
					src=<?php
					if ($ps_Icon == "0") {
						$user_img_path = "../PersonalPhoto/Images/nohead_new.jpg";
						echo $user_img_path;
					} else {
						$path = "../PersonalPhoto/" . $user_id . "/";
						$user_image_name = $path . $ps_Icon;
						echo "'" . $user_image_name . "'";
					}
					?> /></a> <a target="new" class="nickname"
					href="../PersonalSpace/PersonalSpace.php?user_id=<?php echo $user_id;?>"><?php echo $myname;?></a>
				<a target="new" class="preview blue"
					href="../PersonalSpace/PersonalSpace.php?user_id=<?php echo $user_id;?>">预览我的资料</a>
				<ul>
					<li><a target="new" class="blue"
						style="font-size: 20px; width: 120px;"
						href="http://android.myapp.com/myapp/detail.htm?apkName=com.zhuifeng.love2048">寻爱游戏</a></li>
				</ul>
			</div>
			<div class="mail_nav">
				<a class="mail" style="width: 100%;"
					href="../Mailbox/MailboxIndex.php">私信 (<?php echo $message_count;?>封)</a>
			</div>
		</div>
		<div class="yy_main_R">
			<iframe name="frm" frameborder="0" height=800 width="100%"
				src="./today.php"></iframe>
		</div>
	</div>
</body>
</html>